﻿using System;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using System.Threading;
using BZ.Core.TaskExt;

namespace FingerPrintCollection
{
    public partial class TipForm : Office2007Form
    {
        Thread ScanSgn = null;
        public TipForm()
        {
            this.EnableGlass = false;//关键,

            this.FormBorderStyle = FormBorderStyle.None;
            CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
        }

        private void TipForm_Load(object sender, EventArgs e)
        {
            ScanSgn = TaskManager.Run(()=>
            {
                StartScan();
            });
            //ScanSgn = new Thread(new ThreadStart(StartScan));
            //ScanSgn.IsBackground = true;
            //ScanSgn.Start();          
        }

        private void TipForm_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)27)
            {
                this.Close();
                return;
            }
        }

        private  void StartScan()
        {
            while(true)
            {
                if (FPFuction.b_startScanFP)
                {
                    this.Close();
                    break;
                }
                Thread.Sleep(20);
            }
        }
    }
}
